﻿namespace EFS.RC.ConversationBrowser.Controls.Search
{
	public partial class Main : EFS.RC.ConversationBrowser.Controls.Control
	{
		public Main()
		{
			InitializeComponent();

			// ignore in design tool
			if (!System.ComponentModel.DesignerProperties.IsInDesignTool)
			{
				controlCriteria.OnSearchStarted += OnSearchStarted;
				controlCriteria.OnSearchCompleted += OnSearchCompleted;
			}
		}

		#region Events
		/// Search started
		private void OnSearchStarted()
		{
			// reset
			controlResults.Reset();
		}

		/// Search Cmpleted
		private void OnSearchCompleted(EFS.RC.ConversationBrowser.Tools.Search.ResultList items)
		{
			controlResults.LoadData(items);
		}
		#endregion
	}

}